/********* product tab ******/
jQuery(document).ready(function() {
	$('ul.listtab li:first').addClass('listtab_active');
	$('.tabpr_cl:first').show();

	$('ul.listtab li').click(function(){
		$('ul.listtab li').removeClass('listtab_active');
		$(this).addClass('listtab_active');

		var activeTab = $(this).attr("rel"); 
		$('.tabpr_cl').css('display','none');
		$('#'+activeTab).css('display','block');
	});	
}); 

/* hieu ung chay slide anh top */
/* hieu ung select anh thumbail sang anh phong to */

$(document).ready(function() {	
	
	$(".slide4_imagesize").addimagezoom({
			zoomrange: [3, 6],
			magnifiersize: [325,342],
			magnifierpos: 'right',
			cursorshade: true
	});
	
	/*
	function rightzoom(current_str,find_str){
		var cL = current_str.length;
		var fL = find_str.length;
		var pos = current_str.lastIndexOf(find_str);
		if(pos+fL>=cL)
			return "";
		else if(pos==-1)
			return current_str;
		else
			return current_str.substring(pos+fL,cL);
	}
	*/
	
	var hrefcurent = $(".slide4-imgcr:first img").attr('src');
	$(".slide4-imgcr").hide(); 
	$(".slide4-imgcr:first").show();
	$(".slide4-lsview a").attr('href',hrefcurent);
			
	$(".slide4-imgcr").hide(); 
	$(".slide4-imgcr:first").show();
	$('ul.slide4-list li a:first').addClass('listtab_active_ulli');
	
	$("ul.slide4-list li a").click(function() {
		$('ul.slide4-list li a').removeClass('listtab_active_ulli');
		$(this).addClass('listtab_active_ulli');
		
		var activeTab = $(this).attr("rel"); 
		$('.slide4_imagesize').attr('src', activeTab);
		$(".slide4_imagesize").addimagezoom({
			zoomrange: [3, 6],
			magnifiersize: [325,342],
			magnifierpos: 'right',
			cursorshade: true
		});
	});

});